package org.quickjsf.jsf.component;

import javax.el.ValueExpression;
import javax.faces.component.FacesComponent;
import javax.faces.context.FacesContext;

@FacesComponent(DataTable.COMPONENT_TYPE)
public class DataTable extends org.primefaces.component.datatable.DataTable {
	
	public static final String COMPONENT_TYPE = "org.quickjsf.jsf.component.DataTable";
	
	public DataTable() {
		super();
	}
	
	@Override
	public String resolveStaticField(ValueExpression expression) {
		if(expression != null) {
			//直接获得EL表达式的值
			Object value = expression.getValue(FacesContext.getCurrentInstance().getELContext());
			if (value != null) {
				return value.toString();
			}
		}
		return super.resolveStaticField(expression);
	}
}
